package com.ruoyi.system.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GiftChangeReportMapper;
import com.ruoyi.system.domain.GiftChangeReport;
import com.ruoyi.system.service.IGiftChangeReportService;
import com.ruoyi.common.core.text.Convert;

/**
 * 礼物兑换记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-01
 */
@Service
public class GiftChangeReportServiceImpl extends ServiceImpl<GiftChangeReportMapper,GiftChangeReport> implements IGiftChangeReportService

{
    @Autowired
    private GiftChangeReportMapper giftChangeReportMapper;

    /**
     * 查询礼物兑换记录
     * 
     * @param id 礼物兑换记录主键
     * @return 礼物兑换记录
     */
    @Override
    public GiftChangeReport selectGiftChangeReportById(Long id)
    {
        return giftChangeReportMapper.selectGiftChangeReportById(id);
    }

    /**
     * 查询礼物兑换记录列表
     * 
     * @param giftChangeReport 礼物兑换记录
     * @return 礼物兑换记录
     */
    @Override
    public List<GiftChangeReport> selectGiftChangeReportList(GiftChangeReport giftChangeReport)
    {
        return giftChangeReportMapper.selectGiftChangeReportList(giftChangeReport);
    }

    /**
     * 新增礼物兑换记录
     * 
     * @param giftChangeReport 礼物兑换记录
     * @return 结果
     */
    @Override
    public int insertGiftChangeReport(GiftChangeReport giftChangeReport)
    {
        giftChangeReport.setCreateTime(DateUtils.getNowDate());
        return giftChangeReportMapper.insertGiftChangeReport(giftChangeReport);
    }

    /**
     * 修改礼物兑换记录
     * 
     * @param giftChangeReport 礼物兑换记录
     * @return 结果
     */
    @Override
    public int updateGiftChangeReport(GiftChangeReport giftChangeReport)
    {
        return giftChangeReportMapper.updateGiftChangeReport(giftChangeReport);
    }

    /**
     * 批量删除礼物兑换记录
     * 
     * @param ids 需要删除的礼物兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteGiftChangeReportByIds(String ids)
    {
        return giftChangeReportMapper.deleteGiftChangeReportByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除礼物兑换记录信息
     * 
     * @param id 礼物兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteGiftChangeReportById(Long id)
    {
        return giftChangeReportMapper.deleteGiftChangeReportById(id);
    }
}
